﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;

namespace WhsFacebook.Net.Web.Facebook
{
    public static class WhsNameValueListHelpers
    {

        public static void AddDtDd(ControlCollection cc, string name, string definition)
        {
            if (cc == null)
                throw new ArgumentNullException("cc");

            // create name
            {
                var c = new HtmlGenericControl("dt");

                c.InnerText = name;

                cc.Add(c);
            }

            // create description
            {
                var c = new HtmlGenericControl("dd");

                c.InnerText = definition;

                cc.Add(c);
            }
        }

        public static void AddDtDdHtml(ControlCollection cc, string name, string html)
        {
            if (cc == null)
                throw new ArgumentNullException("cc");

            // create name
            {
                var c = new HtmlGenericControl("dt");

                c.InnerText = name;

                cc.Add(c);
            }

            // create description
            {
                var c = new HtmlGenericControl("dd");

                c.InnerHtml = html;

                cc.Add(c);
            }
        }
    }
}